home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 5 / Apprentice-Release5.iso / Source Code / Libraries / VideoToolbox 96.06.15 / VideoToolboxSources / PupilMTF.c < prev    next >
Text File  |  1995-07-19  |  720b  |  24 lines

  1. /*
  2. PupilMTF.c
  3. Returns the MTF of a circular pupil of specified diameter at a specified spatial frequency,
  4. for incoherent light of a specified wavelength. The answer is exact.
  5.  
  6. Based on:
  7. Goodman, J. W. (1968) Introduction to Fourier Optics.  San Francisco: McGraw-Hill,
  8. page 120, Eq. 6-31.
  9. HISTORY:
  10. 7/6/94    dgp     wrote it, again.
  11. */
  12. #include "VideoToolbox.h"
  13. double PupilMTF(double cPerDeg,double diameterMm,double wavelengthNm);
  14.  
  15. double PupilMTF(double cPerDeg,double diameterMm,double wavelengthNm)
  16. {
  17.     register double cPerDegMax,f,mtf;
  18.     
  19.     cPerDegMax=(PI/180.)*diameterMm*1e-3/(wavelengthNm*1e-9);    /* cycles/degree */
  20.     f=fabs(cPerDeg)/cPerDegMax;
  21.     if(f>=1.)mtf=0.;
  22.     else mtf=(2./PI)*(acos(f)-f*sqrt(1-f*f));
  23.     return mtf;
  24. }